﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Table</title>
		<link rel="stylesheet" href="../webjars/plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="../webjars/css/global.css" media="all">
	</head>

	<body>
		<div class="admin-main">
			<blockquote class="layui-elem-quote layui-quote-nm">
				<a class="layui-btn layui-btn-sm layui-btn-normal J_iframe_dialog" href="javascript:;" data-url="./add.html" data-title="添加用户"> 
			      <i class="layui-icon">&#xe608;</i> 添加用户
			    </a>
			</blockquote>
			<fieldset class="layui-elem-field">
				<legend>用户列表</legend>
				<div class="layui-field-box layui-form">
					<table class="layui-table admin-table">
						<thead>
							<tr>
								<th width="80">姓名</th>
								<th width="80">手机</th>
								<th width="180">邮箱</th>
								<th width="50">状态</th>
								<th width="300">操作</th>
							</tr>
						</thead>
						<tbody id="content" dataLoad="../admin/user/list" template-id="list_tpl"></tbody>
					</table>
				</div>
			</fieldset>
		</div>
		<!--模板-->
		<script type="text/html" id="list_tpl">
			{{# layui.each(d, function(index, item){ }}
			<tr>
				<td>{{ item.name }}</td>
				<td>{{ item.mobile }}</td>
				<td>{{ item.email }}</td>
                <td>{{ item.status == 1 ? '启用' : '禁用' }}</td>
				<td>
                    <a class="layui-btn layui-btn-sm layui-btn-normal J_iframe_dialog" href="javascript:;" data-title="查看权限" data-url="./userPermissions.html?id={{ item.id }}">查看权限</a>
                    <a href="javascript:;" class="layui-btn layui-btn-sm {{  item.status == 1 ? 'layui-btn-danger' : 'layui-btn-normal'}} J_confirm" data-url="../admin/user/switch/{{ item.id }}" onSuccessCallback="reload">{{ item.status == 1 ? '禁用' : '启用'}}</a>
					<a href="javascript:;" class="J_confirm layui-btn layui-btn-danger layui-btn-sm" data-url="../admin/user/delete/{{ item.id }}">删除</a>
				</td>
			</tr>
			{{# }); }}
		</script>
		<script type="text/javascript" src="../webjars/plugins/layui/layui.js"></script>
        <script type="text/javascript" src="../webjars/js/jeesuitelayui.js?v20180420"></script>
	</body>

</html>